-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
attach images in email #2784
attach images in email #2784
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be an option to add a new config option, SMTP_EMBED_IMAGES
or something like that and have it dynamically embed or provide the external link.
The only thing is that the images are fully internal. So, if someone wants to change them it will not be easy besides for them to compile them selfs with a changed image file.
But in those cases someone probably wants to do more changes, so I'm not too worried about that.
Okay, I will look into that. |
7aaa41c
to
8666adc
Compare
Put the images inthere as true svgs if possible, they are code so will
render in email even without a request from the user
Op zo 2 okt. 2022 om 03:04 schreef Stefan Melmuk ***@***.***>
… Since many email clients don't load external images I was wondering if we
should include the images as attachment instead.
Some drawbacks to this change:
- Embedding the images as attachments makes the mails around ~5kb
bigger.
- If you want too change the templates the mail would still attach the
images.
------------------------------
You can view, comment on, or merge this pull request online at:
#2784
Commit Summary
- 2868a66
<2868a66>
attach images in email
File Changes
(3 files <https://github.com/dani-garcia/vaultwarden/pull/2784/files>)
- *M* src/mail.rs
<https://github.com/dani-garcia/vaultwarden/pull/2784/files#diff-02d3b205a438920e7c90dc9a121d5f81f2f04940aea6f9c2b48c7adea12305db>
(21)
- *M* src/static/templates/email/email_footer.hbs
<https://github.com/dani-garcia/vaultwarden/pull/2784/files#diff-bc86d9b9425d4877f78232f9e7e7ce9fbc598b3e15efce623df41bf5c9726d90>
(2)
- *M* src/static/templates/email/email_header.hbs
<https://github.com/dani-garcia/vaultwarden/pull/2784/files#diff-55486ec3af179bfee475e71ce646f61e80adaf1076aa1f4d8a41b0726255aa71>
(2)
Patch Links:
- https://github.com/dani-garcia/vaultwarden/pull/2784.patch
- https://github.com/dani-garcia/vaultwarden/pull/2784.diff
—
Reply to this email directly, view it on GitHub
<#2784>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHPNV26RV46JIQAOBBDFRZTWBDNRFANCNFSM6AAAAAAQ2VYB7A>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
That probably isn't working for all clients, and probably suffers from the same issues as using a base64 image src, that some client's just block that by default without a way to show it at all.
|
25c74e2
to
e5c3ac7
Compare
67e0cb5
to
ea37934
Compare
Set SMTP_EMBED_IMAGES option to false if you don't want to attach images to the mail. NOTE: If you have customized the template files `email_header.hbs` and `email_footer.hbs` you can replace `{url}/vw_static/` to `{img_url}` to support both URL schemes
Apply suggestions from code review Co-authored-by: Mathijs van Veluw <black.dex@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested it and looks good to me.
It just needs an other re-base :)
ea37934
to
4289663
Compare
Since many email clients don't load external images I was wondering if we should include the images as attachment instead.
Some drawbacks to this change: